<script setup lang="ts">
import { NButton, NIcon } from "naive-ui";
import { useElectron } from "./electron";
import { withDefaults, defineProps } from "vue";

interface IProps {
  checkElectron?: boolean;
}

const props = withDefaults(defineProps<IProps>(), {
  checkElectron: false,
});

const { isElectron } = useElectron();
</script>

<template>
  <NButton
    v-if="!props.checkElectron || (props.checkElectron && isElectron)"
    :bordered="false"
    :focusable="false"
    class="tw-rounded-none"
    style="-webkit-app-region: no-drag"
  >
    <NIcon>
      <slot></slot>
    </NIcon>
  </NButton>
</template>

<style scoped></style>
